<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>人际关系列表 - 兴趣社交</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #f0f4ff;
            --secondary: #64748b;
            --light: #f8fafc;
            --dark: #1e293b;
            --success: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --border: #e2e8f0;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
        
        body {
            font-family: 'Inter', system-ui, sans-serif;
            background-color: #f8fafc;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .navbar {
            box-shadow: var(--shadow);
            background-color: white;
        }
        
        .container {
            padding: 2rem 0;
        }
        
        .section-header {
            margin-bottom: 2rem;
        }
        
        .section-title {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }
        
        .section-desc {
            color: var(--secondary);
            max-width: 800px;
        }
        
        /* 筛选区域样式 */
        .filters-container {
            background-color: white;
            border-radius: 0.75rem;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 2rem;
        }
        
        .filter-section {
            margin-bottom: 1.5rem;
        }
        
        .filter-section:last-child {
            margin-bottom: 0;
        }
        
        .filter-title {
            font-weight: 600;
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
        }
        
        .filter-tag {
            background-color: var(--light);
            border: 1px solid var(--border);
            border-radius: 999px;
            padding: 0.375rem 1rem;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .filter-tag:hover {
            background-color: var(--primary-light);
            border-color: var(--primary);
            color: var(--primary);
        }
        
        .filter-tag.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        .search-container {
            position: relative;
            max-width: 400px;
        }
        
        .search-input {
            width: 100%;
            padding: 0.625rem 1rem 0.625rem 2.5rem;
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            font-size: 0.95rem;
            transition: border-color 0.2s;
        }
        
        .search-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }
        
        .search-icon {
            position: absolute;
            left: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--secondary);
        }
        
        .filter-actions {
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
            margin-top: 1rem;
        }
        
        .range-slider {
            width: 100%;
            margin: 1rem 0;
        }
        
        .range-labels {
            display: flex;
            justify-content: space-between;
            font-size: 0.85rem;
            color: var(--secondary);
        }
        
        select.form-select {
            border-color: var(--border);
        }
        
        select.form-select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }
        
        /* 列表展示样式 */
        .relations-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        
        .relation-card {
            background-color: white;
            border-radius: 0.75rem;
            box-shadow: var(--shadow);
            overflow: hidden;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        
        .relation-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-hover);
        }
        
        .relation-card .image-container {
            width: 100%;
            height: 180px;
            overflow: hidden;
        }
        
        .relation-card .card-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s;
        }
        
        .relation-card:hover .card-image {
            transform: scale(1.05);
        }
        
        .relation-card .no-image {
            width: 100%;
            height: 180px;
            background-color: var(--light);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: var(--secondary);
        }
        
        .relation-card .no-image i {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
            color: var(--primary-light);
        }
        
        .relation-card .card-body {
            padding: 1.25rem;
        }
        
        .relation-type {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 999px;
            font-size: 0.75rem;
            font-weight: 500;
            margin-bottom: 0.75rem;
        }
        
        .type-friend {
            background-color: rgba(16, 185, 129, 0.1);
            color: var(--success);
        }
        
        .type-colleague {
            background-color: rgba(79, 70, 229, 0.1);
            color: var(--primary);
        }
        
        .type-classmate {
            background-color: rgba(245, 158, 11, 0.1);
            color: var(--warning);
        }
        
        .type-family {
            background-color: rgba(239, 68, 68, 0.1);
            color: var(--danger);
        }
        
        .relation-card .card-title {
            font-weight: 600;
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
            transition: color 0.2s;
        }
        
        .relation-card:hover .card-title {
            color: var(--primary);
        }
        
        .relation-card .card-text {
            color: var(--secondary);
            font-size: 0.9rem;
            margin-bottom: 1rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .author-info {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }
        
        .author-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .author-name {
            font-weight: 500;
        }
        
        .author-meta {
            font-size: 0.8rem;
            color: var(--secondary);
        }
        
        .card-meta {
            display: flex;
            align-items: center;
            gap: 1rem;
            color: var(--secondary);
            font-size: 0.85rem;
            margin-bottom: 1rem;
        }
        
        .meta-item {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        
        .card-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .action-buttons {
            display: flex;
            gap: 0.75rem;
        }
        
        .action-btn {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.85rem;
            color: var(--secondary);
            background: none;
            border: none;
            cursor: pointer;
            transition: color 0.2s;
        }
        
        .action-btn:hover {
            color: var(--primary);
        }
        
        .action-btn.liked {
            color: var(--danger);
        }
        
        .action-btn.bookmarked {
            color: var(--primary);
        }
        
        /* 分页样式 */
        .pagination-container {
            display: flex;
            justify-content: center;
            margin-top: 2rem;
        }
        
        .pagination {
            --bs-pagination-color: var(--secondary);
            --bs-pagination-active-color: white;
            --bs-pagination-active-bg: var(--primary);
            --bs-pagination-active-border-color: var(--primary);
            --bs-pagination-hover-color: var(--primary);
        }
        
        /* 响应式设计 */
        @media (max-width: 992px) {
            .filters-row {
                flex-direction: column;
                gap: 1.5rem;
            }
            
            .filter-col {
                width: 100% !important;
            }
        }
        
        @media (max-width: 768px) {
            .relations-list {
                grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            }
            
            .section-title {
                font-size: 1.5rem;
            }
        }
        
        @media (max-width: 576px) {
            .relations-list {
                grid-template-columns: 1fr;
            }
            
            .filter-options {
                gap: 0.5rem;
            }
            
            .filter-tag {
                padding: 0.25rem 0.75rem;
                font-size: 0.85rem;
            }
            
            .filter-actions {
                flex-direction: column;
                align-items: stretch;
            }
            
            .filter-actions .btn {
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-light">
        <div class="container">
            <a class="navbar-brand" href="#">
                <i class="fas fa-users text-primary me-2"></i>兴趣社交
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="#">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">兴趣测试</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active" href="#">人际关系</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">社区</a>
                    </li>
                </ul>
                <div class="d-flex align-items-center gap-3">
                    <button class="btn btn-outline-primary">登录</button>
                    <button class="btn btn-primary">注册</button>
                </div>
            </div>
        </div>
    </nav>
    
    <!-- 主要内容区 -->
    <div class="container">
        <div class="section-header">
            <h1 class="section-title">人际关系列表</h1>
            <p class="section-desc">通过以下筛选条件，找到你感兴趣的人际关系。根据不同维度筛选，发现更多可能的连接。</p>
        </div>
        
        <!-- 筛选区域 -->
        <div class="filters-container">
            <!-- 搜索框 -->
            <div class="filter-section">
                <div class="search-container">
                    <i class="fas fa-search search-icon"></i>
                    <input type="text" class="search-input" placeholder="搜索姓名、标签或关键词...">
                </div>
            </div>
            
            <div class="row filters-row">
                <!-- 关系类型筛选 -->
                <div class="col-md-3 filter-col">
                    <div class="filter-section">
                        <h3 class="filter-title">
                            <i class="fas fa-link text-primary"></i>关系类型
                        </h3>
                        <div class="filter-options">
                            <div class="filter-tag active" data-filter="relation" data-value="all">全部</div>
                            <div class="filter-tag" data-filter="relation" data-value="friend">朋友</div>
                            <div class="filter-tag" data-filter="relation" data-value="colleague">同事</div>
                            <div class="filter-tag" data-filter="relation" data-value="classmate">同学</div>
                            <div class="filter-tag" data-filter="relation" data-value="family">家人</div>
                            <div class="filter-tag" data-filter="relation" data-value="other">其他</div>
                        </div>
                    </div>
                </div>
                
                <!-- 兴趣标签筛选 -->
                <div class="col-md-3 filter-col">
                    <div class="filter-section">
                        <h3 class="filter-title">
                            <i class="fas fa-tag text-primary"></i>兴趣标签
                        </h3>
                        <div class="filter-options">
                            <div class="filter-tag active" data-filter="interest" data-value="all">全部</div>
                            <div class="filter-tag" data-filter="interest" data-value="photography">摄影</div>
                            <div class="filter-tag" data-filter="interest" data-value="music">音乐</div>
                            <div class="filter-tag" data-filter="interest" data-value="reading">阅读</div>
                            <div class="filter-tag" data-filter="interest" data-value="sports">运动</div>
                            <div class="filter-tag" data-filter="interest" data-value="travel">旅行</div>
                            <div class="filter-tag" data-filter="interest" data-value="cooking">烹饪</div>
                        </div>
                    </div>
                </div>
                
                <!-- 距离筛选 -->
                <div class="col-md-3 filter-col">
                    <div class="filter-section">
                        <h3 class="filter-title">
                            <i class="fas fa-map-marker-alt text-primary"></i>距离范围
                        </h3>
                        <input type="range" min="1" max="50" value="20" class="range-slider form-range" id="distanceRange">
                        <div class="range-labels">
                            <span>1km</span>
                            <span id="rangeValue">20km</span>
                            <span>50km</span>
                        </div>
                    </div>
                </div>
                
                <!-- 排序筛选 -->
                <div class="col-md-3 filter-col">
                    <div class="filter-section">
                        <h3 class="filter-title">
                            <i class="fas fa-sort text-primary"></i>排序方式
                        </h3>
                        <select class="form-select" id="sortSelect">
                            <option value="relevance">按相关性</option>
                            <option value="distance">按距离远近</option>
                            <option value="popularity">按人气高低</option>
                            <option value="recent">按最近活跃</option>
                            <option value="common">按共同好友</option>
                        </select>
                    </div>
                </div>
            </div>
            
            <!-- 筛选操作按钮 -->
            <div class="filter-actions">
                <button class="btn btn-outline-secondary" id="resetFilters">
                    <i class="fas fa-sync-alt me-1"></i>重置筛选
                </button>
                <button class="btn btn-primary" id="applyFilters">
                    <i class="fas fa-filter me-1"></i>应用筛选
                </button>
            </div>
        </div>
        
        <!-- 筛选结果统计 -->
        <div class="d-flex justify-content-between align-items-center mb-3">
            <div>
                <span class="fw-semibold">找到</span>
                <span class="fw-bold text-primary" id="resultsCount">12</span>
                <span class="fw-semibold">个符合条件的人际关系</span>
            </div>
            <div class="d-flex gap-2">
                <button class="btn btn-sm btn-outline-secondary active" data-view="grid">
                    <i class="fas fa-th"></i>
                </button>
                <button class="btn btn-sm btn-outline-secondary" data-view="list">
                    <i class="fas fa-list"></i>
                </button>
            </div>
        </div>
        
        <!-- 人际关系列表 -->
        <div class="relations-list" id="relationsContainer">
            <!-- 关系卡片1 -->
            <div class="relation-card" data-relation="friend" data-interest="photography" data-distance="3">
                <div class="image-container">
                    <img src="https://picsum.photos/600/400?random=10" alt="张晓明的活动照片" class="card-image">
                </div>
                <div class="card-body">
                    <span class="relation-type type-friend">朋友</span>
                    <h5 class="card-title">张晓明 - 摄影爱好者</h5>
                    <p class="card-text">我们有5个共同好友，都喜欢户外摄影和旅行。张晓明最近参加了"城市风光摄影展"。</p>
                    
                    <div class="author-info">
                        <img src="https://picsum.photos/100/100?random=101" alt="张晓明的头像" class="author-avatar">
                        <div>
                            <div class="author-name">张晓明</div>
                            <div class="author-meta">摄影师 · 3km</div>
                        </div>
                    </div>
                    
                    <div class="card-meta">
                        <div class="meta-item">
                            <i class="far fa-eye"></i>
                            <span>2.3k</span>
                        </div>
                        <div class="meta-item">
                            <i class="far fa-comment"></i>
                            <span>48</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-user-friends"></i>
                            <span>5个共同好友</span>
                        </div>
                    </div>
                    
                    <div class="card-actions">
                        <div class="action-buttons">
                            <button class="action-btn like-btn">
                                <i class="far fa-heart"></i>
                                <span>126</span>
                            </button>
                            <button class="action-btn bookmark-btn">
                                <i class="far fa-bookmark"></i>
                                <span>32</span>
                            </button>
                        </div>
                        <button class="btn btn-sm btn-primary">加好友</button>
                    </div>
                </div>
            </div>
            
            <!-- 关系卡片2 -->
            <div class="relation-card" data-relation="colleague" data-interest="photography" data-distance="5">
                <div class="image-container">
                    <div class="multi-images" style="display: grid; grid-template-columns: 1fr 1fr; gap: 4px; height: 100%;">
                        <img src="https://picsum.photos/300/300?random=21" alt="李婷的照片1" class="card-image">
                        <img src="https://picsum.photos/300/300?random=22" alt="李婷的照片2" class="card-image">
                        <img src="https://picsum.photos/300/300?random=23" alt="李婷的照片3" class="card-image">
                        <img src="https://picsum.photos/300/300?random=24" alt="李婷的照片4" class="card-image">
                    </div>
                </div>
                <div class="card-body">
                    <span class="relation-type type-colleague">同事</span>
                    <h5 class="card-title">李婷 - 平面设计师</h5>
                    <p class="card-text">李婷是一位经验丰富的平面设计师，擅长视觉创意和品牌设计。她关注了你的作品。</p>
                    
                    <div class="author-info">
                        <img src="https://picsum.photos/100/100?random=102" alt="李婷的头像" class="author-avatar">
                        <div>
                            <div class="author-name">李婷</div>
                            <div class="author-meta">设计师 · 5km</div>
                        </div>
                    </div>
                    
                    <div class="card-meta">
                        <div class="meta-item">
                            <i class="far fa-eye"></i>
                            <span>1.8k</span>
                        </div>
                        <div class="meta-item">
                            <i class="far fa-comment"></i>
                            <span>36</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-user-friends"></i>
                            <span>2个共同好友</span>
                        </div>
                    </div>
                    
                    <div class="card-actions">
                        <div class="action-buttons">
                            <button class="action-btn like-btn">
                                <i class="far fa-heart"></i>
                                <span>98</span>
                            </button>
                            <button class="action-btn bookmark-btn">
                                <i class="far fa-bookmark"></i>
                                <span>24</span>
                            </button>
                        </div>
                        <button class="btn btn-sm btn-primary">加好友</button>
                    </div>
                </div>
            </div>
            
            <!-- 关系卡片3 -->
            <div class="relation-card" data-relation="classmate" data-interest="reading" data-distance="8">
                <div class="image-container">
                    <div class="no-image">
                        <i class="fas fa-book"></i>
                        <p>阅读爱好者</p>
                    </div>
                </div>
                <div class="card-body">
                    <span class="relation-type type-classmate">同学</span>
                    <h5 class="card-title">王建国 - 建筑工程师</h5>
                    <p class="card-text">和你毕业于同一所大学，现在从事建筑设计工作。喜欢建筑摄影和阅读。</p>
                    
                    <div class="author-info">
                        <img src="https://picsum.photos/100/100?random=103" alt="王建国的头像" class="author-avatar">
                        <div>
                            <div class="author-name">王建国</div>
                            <div class="author-meta">工程师 · 8km</div>
                        </div>
                    </div>
                    
                    <div class="card-meta">
                        <div class="meta-item">
                            <i class="far fa-eye"></i>
                            <span>1.2k</span>
                        </div>
                        <div class="meta-item">
                            <i class="far fa-comment"></i>
                            <span>27</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-user-friends"></i>
                            <span>8个共同好友</span>
                        </div>
                    </div>
                    
                    <div class="card-actions">
                        <div class="action-buttons">
                            <button class="action-btn like-btn">
                                <i class="far fa-heart"></i>
                                <span>76</span>
                            </button>
                            <button class="action-btn bookmark-btn">
                                <i class="far fa-bookmark"></i>
                                <span>18</span>
                            </button>
                        </div>
                        <button class="btn btn-sm btn-primary">加好友</button>
                    </div>
                </div>
            </div>
            
            <!-- 关系卡片4 -->
            <div class="relation-card" data-relation="friend" data-interest="travel" data-distance="12">
                <div class="image-container">
                    <img src="https://picsum.photos/600/400?random=30" alt="刘芳的旅行照片" class="card-image">
                </div>
                <div class="card-body">
                    <span class="relation-type type-friend">朋友</span>
                    <h5 class="card-title">刘芳 - 旅行摄影师</h5>
                    <p class="card-text">刘芳是一位资深旅行摄影师，去过20多个国家拍摄自然风光和人文景观。</p>
                    
                    <div class="author-info">
                        <img src="https://picsum.photos/100/100?random=104" alt="刘芳的头像" class="author-avatar">
                        <div>
                            <div class="author-name">刘芳</div>
                            <div class="author-meta">旅行摄影师 · 12km</div>
                        </div>
                    </div>
                    
                    <div class="card-meta">
                        <div class="meta-item">
                            <i class="far fa-eye"></i>
                            <span>5.7k</span>
                        </div>
                        <div class="meta-item">
                            <i class="far fa-comment"></i>
                            <span>132</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-user-friends"></i>
                            <span>3个共同好友</span>
                        </div>
                    </div>
                    
                    <div class="card-actions">
                        <div class="action-buttons">
                            <button class="action-btn like-btn">
                                <i class="far fa-heart"></i>
                                <span>356</span>
                            </button>
                            <button class="action-btn bookmark-btn">
                                <i class="far fa-bookmark"></i>
                                <span>89</span>
                            </button>
                        </div>
                        <button class="btn btn-sm btn-primary">加好友</button>
                    </div>
                </div>
            </div>
            
            <!-- 关系卡片5 -->
            <div class="relation-card" data-relation="colleague" data-interest="photography" data-distance="15">
                <div class="image-container">
                    <div class="no-image">
                        <i class="fas fa-camera"></i>
                        <p>摄影博主</p>
                    </div>
                </div>
                <div class="card-body">
                    <span class="relation-type type-colleague">同事</span>
                    <h5 class="card-title">陈明 - 商业摄影师</h5>
                    <p class="card-text">陈明拥有10年商业摄影经验，专注于产品和广告摄影。作品曾多次获奖。</p>
                    
                    <div class="author-info">
                        <img src="https://picsum.photos/100/100?random=105" alt="陈明的头像" class="author-avatar">
                        <div>
                            <div class="author-name">陈明</div>
                            <div class="author-meta">商业摄影师 · 15km</div>
                        </div>
                    </div>
                    
                    <div class="card-meta">
                        <div class="meta-item">
                            <i class="far fa-eye"></i>
                            <span>8.2k</span>
                        </div>
                        <div class="meta-item">
                            <i class="far fa-comment"></i>
                            <span>215</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-user-friends"></i>
                            <span>1个共同好友</span>
                        </div>
                    </div>
                    
                    <div class="card-actions">
                        <div class="action-buttons">
                            <button class="action-btn like-btn">
                                <i class="far fa-heart"></i>
                                <span>528</span>
                            </button>
                            <button class="action-btn bookmark-btn">
                                <i class="far fa-bookmark"></i>
                                <span>156</span>
                            </button>
                        </div>
                        <button class="btn btn-sm btn-primary">加好友</button>
                    </div>
                </div>
            </div>
            
            <!-- 关系卡片6 -->
            <div class="relation-card" data-relation="other" data-interest="sports" data-distance="2">
                <div class="image-container">
                    <img src="https://picsum.photos/600/400?random=41" alt="赵晓的运动照片" class="card-image">
                </div>
                <div class="card-body">
                    <span class="relation-type type-friend">其他</span>
                    <h5 class="card-title">赵晓 - 健身教练</h5>
                    <p class="card-text">距离1.2km，专业健身教练，喜欢户外运动和马拉松，经常组织社区健身活动。</p>
                    
                    <div class="author-info">
                        <img src="https://picsum.photos/100/100?random=106" alt="赵晓的头像" class="author-avatar">
                        <div>
                            <div class="author-name">赵晓</div>
                            <div class="author-meta">健身教练 · 2km</div>
                        </div>
                    </div>
                    
                    <div class="card-meta">
                        <div class="meta-item">
                            <i class="far fa-eye"></i>
                            <span>856</span>
                        </div>
                        <div class="meta-item">
                            <i class="far fa-comment"></i>
                            <span>42</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-user-friends"></i>
                            <span>0个共同好友</span>
                        </div>
                    </div>
                    
                    <div class="card-actions">
                        <div class="action-buttons">
                            <button class="action-btn like-btn">
                                <i class="far fa-heart"></i>
                                <span>68</span>
                            </button>
                            <button class="action-btn bookmark-btn">
                                <i class="far fa-bookmark"></i>
                                <span>15</span>
                            </button>
                        </div>
                        <button class="btn btn-sm btn-primary">加好友</button>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 分页 -->
        <div class="pagination-container">
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li class="page-item disabled">
                        <a class="page-link" href="#" tabindex="-1" aria-disabled="true">上一页</a>
                    </li>
                    <li class="page-item active"><a class="page-link" href="#">1</a></li>
                    <li class="page-item"><a class="page-link" href="#">2</a></li>
                    <li class="page-item"><a class="page-link" href="#">3</a></li>
                    <li class="page-item">
                        <a class="page-link" href="#">下一页</a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 筛选标签切换
            const filterTags = document.querySelectorAll('.filter-tag');
            filterTags.forEach(tag => {
                tag.addEventListener('click', function() {
                    const filterType = this.getAttribute('data-filter');
                    
                    // 移除同类型筛选标签的active类
                    document.querySelectorAll(`.filter-tag[data-filter="${filterType}"]`).forEach(t => {
                        t.classList.remove('active');
                    });
                    
                    // 给当前点击的标签添加active类
                    this.classList.add('active');
                });
            });
            
            // 距离滑块
            const distanceRange = document.getElementById('distanceRange');
            const rangeValue = document.getElementById('rangeValue');
            
            distanceRange.addEventListener('input', function() {
                rangeValue.textContent = `${this.value}km`;
            });
            
            // 筛选结果统计
            function updateResultsCount() {
                const visibleCards = document.querySelectorAll('.relation-card:not([style*="display: none"])');
                document.getElementById('resultsCount').textContent = visibleCards.length;
            }
            
            // 应用筛选
            document.getElementById('applyFilters').addEventListener('click', function() {
                // 获取选中的筛选条件
                const selectedRelation = document.querySelector('.filter-tag[data-filter="relation"].active').getAttribute('data-value');
                const selectedInterest = document.querySelector('.filter-tag[data-filter="interest"].active').getAttribute('data-value');
                const selectedDistance = parseInt(distanceRange.value);
                
                // 筛选卡片
                const relationCards = document.querySelectorAll('.relation-card');
                relationCards.forEach(card => {
                    const cardRelation = card.getAttribute('data-relation');
                    const cardInterest = card.getAttribute('data-interest');
                    const cardDistance = parseInt(card.getAttribute('data-distance'));
                    
                    // 检查是否符合所有筛选条件
                    const relationMatch = selectedRelation === 'all' || cardRelation === selectedRelation;
                    const interestMatch = selectedInterest === 'all' || cardInterest === selectedInterest;
                    const distanceMatch = cardDistance <= selectedDistance;
                    
                    // 显示或隐藏卡片
                    if (relationMatch && interestMatch && distanceMatch) {
                        card.style.display = '';
                    } else {
                        card.style.display = 'none';
                    }
                });
                
                // 更新结果计数
                updateResultsCount();
                
                // 显示筛选成功提示（可选）
                showNotification('筛选已应用');
            });
            
            // 重置筛选
            document.getElementById('resetFilters').addEventListener('click', function() {
                // 重置所有筛选标签
                document.querySelectorAll('.filter-tag[data-value="all"]').forEach(tag => {
                    const filterType = tag.getAttribute('data-filter');
                    document.querySelectorAll(`.filter-tag[data-filter="${filterType}"]`).forEach(t => {
                        t.classList.remove('active');
                    });
                    tag.classList.add('active');
                });
                
                // 重置距离滑块
                distanceRange.value = 20;
                rangeValue.textContent = '20km';
                
                // 重置排序选择
                document.getElementById('sortSelect').value = 'relevance';
                
                // 显示所有卡片
                document.querySelectorAll('.relation-card').forEach(card => {
                    card.style.display = '';
                });
                
                // 更新结果计数
                updateResultsCount();
                
                // 显示重置提示（可选）
                showNotification('筛选已重置');
            });
            
            // 视图切换（网格/列表）
            const viewButtons = document.querySelectorAll('[data-view]');
            viewButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const viewType = this.getAttribute('data-view');
                    
                    // 更新按钮状态
                    viewButtons.forEach(btn => btn.classList.remove('active'));
                    this.classList.add('active');
                    
                    // 切换视图
                    const container = document.getElementById('relationsContainer');
                    if (viewType === 'list') {
                        container.style.gridTemplateColumns = '1fr';
                    } else {
                        container.style.gridTemplateColumns = 'repeat(auto-fill, minmax(300px, 1fr))';
                    }
                });
            });
            
            // 点赞功能
            const likeButtons = document.querySelectorAll('.like-btn');
            likeButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const icon = this.querySelector('i');
                    const countElement = this.querySelector('span');
                    let count = parseInt(countElement.textContent);
                    
                    if (this.classList.contains('liked')) {
                        // 取消点赞
                        this.classList.remove('liked');
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        countElement.textContent = count - 1;
                    } else {
                        // 点赞
                        this.classList.add('liked');
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        countElement.textContent = count + 1;
                    }
                });
            });
            
            // 收藏功能
            const bookmarkButtons = document.querySelectorAll('.bookmark-btn');
            bookmarkButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const icon = this.querySelector('i');
                    const countElement = this.querySelector('span');
                    let count = parseInt(countElement.textContent);
                    
                    if (this.classList.contains('bookmarked')) {
                        // 取消收藏
                        this.classList.remove('bookmarked');
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        countElement.textContent = count - 1;
                    } else {
                        // 收藏
                        this.classList.add('bookmarked');
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        countElement.textContent = count + 1;
                    }
                });
            });
            
            // 加好友按钮功能
            const addFriendButtons = document.querySelectorAll('.btn-primary:not(#applyFilters)');
            addFriendButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const originalText = this.innerHTML;
                    
                    if (originalText.includes('加好友')) {
                        this.innerHTML = '<i class="fas fa-check me-1"></i> 已添加';
                        this.classList.remove('btn-primary');
                        this.classList.add('btn-success');
                        showNotification('已成功添加好友');
                    } else {
                        this.innerHTML = '<i class="fas fa-user-plus me-1"></i> 加好友';
                        this.classList.remove('btn-success');
                        this.classList.add('btn-primary');
                        showNotification('已取消添加好友');
                    }
                });
            });
            

        });
    </script>
</body>
</html>
    
